<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenLoong Dynamics Control: ramp_trajectory.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenLoong Dynamics Control
   &#160;<span id="projectnumber">v0.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ramp_trajectory.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">This is part of OpenLoong Dynamics Control, an open project for the control of biped robot,</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">Copyright (C) 2024 Humanoid Robot (Shanghai) Co., Ltd, under Apache 2.0.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">Feel free to use in any purpose, and cite OpenLoong-Dynamics-Control in any style, to contribute to the advancement of the community.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> &lt;https://gitee.com/panda_23/openloong-dyn-control.git&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> &lt;web@openloong.org.cn&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classRampTrajectory.html">   17</a></span>&#160;<span class="keyword">class </span><a class="code" href="classRampTrajectory.html">RampTrajectory</a> {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="classRampTrajectory.html#a58c602af7651d788d77c982a6a0cf255">   19</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRampTrajectory.html#a58c602af7651d788d77c982a6a0cf255">dt</a>;  </div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classRampTrajectory.html#ac41bb550cf0b32ca1d50275443b3bca9">   20</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRampTrajectory.html#ac41bb550cf0b32ca1d50275443b3bca9">y</a>;   </div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classRampTrajectory.html#aac1dd0865c7fed61f79b83c96506166d">   21</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRampTrajectory.html#aac1dd0865c7fed61f79b83c96506166d">yDes</a>;    </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classRampTrajectory.html#a80103af9c7d2f6da435290e3c20d06f0">   28</a></span>&#160;    <a class="code" href="classRampTrajectory.html#a80103af9c7d2f6da435290e3c20d06f0">RampTrajectory</a>(<span class="keywordtype">double</span> dtIn):<a class="code" href="classRampTrajectory.html#a58c602af7651d788d77c982a6a0cf255">dt</a>{dtIn},yOld{0},k{0},<a class="code" href="classRampTrajectory.html#aac1dd0865c7fed61f79b83c96506166d">yDes</a>{0}{};</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classRampTrajectory.html#af583163f076e5bee4ab6ed8d1948c157">setPara</a>(<span class="keywordtype">double</span> yDesIn, <span class="keywordtype">double</span> timeToReach);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classRampTrajectory.html#a4ac02392feeeb3df24259609cc77d68a">setParaDirt</a>(<span class="keywordtype">double</span> yDesIn, <span class="keywordtype">double</span> delta_y);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRampTrajectory.html#a11bb16712606bfa6edf25d7b8d182b55">step</a>();</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classRampTrajectory.html#af83b54486e008916beb4067b6af630c8">isReachDes</a>();</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classRampTrajectory.html#add57cb4e79e39f6de0edf35a82fcd040">resetOut</a>(<span class="keywordtype">double</span> yOut);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">double</span> yOld;    </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">double</span> k;       </div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;};</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassRampTrajectory_html_a58c602af7651d788d77c982a6a0cf255"><div class="ttname"><a href="classRampTrajectory.html#a58c602af7651d788d77c982a6a0cf255">RampTrajectory::dt</a></div><div class="ttdeci">double dt</div><div class="ttdoc">trajectory step time interval</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8h_source.html#l00019">ramp_trajectory.h:19</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_ac41bb550cf0b32ca1d50275443b3bca9"><div class="ttname"><a href="classRampTrajectory.html#ac41bb550cf0b32ca1d50275443b3bca9">RampTrajectory::y</a></div><div class="ttdeci">double y</div><div class="ttdoc">current position</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8h_source.html#l00020">ramp_trajectory.h:20</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_a11bb16712606bfa6edf25d7b8d182b55"><div class="ttname"><a href="classRampTrajectory.html#a11bb16712606bfa6edf25d7b8d182b55">RampTrajectory::step</a></div><div class="ttdeci">double step()</div><div class="ttdoc">return the next desired position in trajectory</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8cpp_source.html#l00023">ramp_trajectory.cpp:23</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_a4ac02392feeeb3df24259609cc77d68a"><div class="ttname"><a href="classRampTrajectory.html#a4ac02392feeeb3df24259609cc77d68a">RampTrajectory::setParaDirt</a></div><div class="ttdeci">void setParaDirt(double yDesIn, double delta_y)</div><div class="ttdoc">Set the parameter using one step distance.</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8cpp_source.html#l00018">ramp_trajectory.cpp:18</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_af83b54486e008916beb4067b6af630c8"><div class="ttname"><a href="classRampTrajectory.html#af83b54486e008916beb4067b6af630c8">RampTrajectory::isReachDes</a></div><div class="ttdeci">bool isReachDes()</div><div class="ttdoc">check whether has reached the destination</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8cpp_source.html#l00031">ramp_trajectory.cpp:31</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_aac1dd0865c7fed61f79b83c96506166d"><div class="ttname"><a href="classRampTrajectory.html#aac1dd0865c7fed61f79b83c96506166d">RampTrajectory::yDes</a></div><div class="ttdeci">double yDes</div><div class="ttdoc">desired position</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8h_source.html#l00021">ramp_trajectory.h:21</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_af583163f076e5bee4ab6ed8d1948c157"><div class="ttname"><a href="classRampTrajectory.html#af583163f076e5bee4ab6ed8d1948c157">RampTrajectory::setPara</a></div><div class="ttdeci">void setPara(double yDesIn, double timeToReach)</div><div class="ttdoc">Set the parameter using the disired reaching time.</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8cpp_source.html#l00011">ramp_trajectory.cpp:11</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html"><div class="ttname"><a href="classRampTrajectory.html">RampTrajectory</a></div><div class="ttdoc">This class implements a ramp trajectory object.</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8h_source.html#l00017">ramp_trajectory.h:17</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_add57cb4e79e39f6de0edf35a82fcd040"><div class="ttname"><a href="classRampTrajectory.html#add57cb4e79e39f6de0edf35a82fcd040">RampTrajectory::resetOut</a></div><div class="ttdeci">void resetOut(double yOut)</div><div class="ttdoc">overwrite the current and last position</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8cpp_source.html#l00038">ramp_trajectory.cpp:38</a></div></div>
<div class="ttc" id="aclassRampTrajectory_html_a80103af9c7d2f6da435290e3c20d06f0"><div class="ttname"><a href="classRampTrajectory.html#a80103af9c7d2f6da435290e3c20d06f0">RampTrajectory::RampTrajectory</a></div><div class="ttdeci">RampTrajectory(double dtIn)</div><div class="ttdoc">Construct a new Ramp Trajectory object.</div><div class="ttdef"><b>Definition:</b> <a href="ramp__trajectory_8h_source.html#l00028">ramp_trajectory.h:28</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
